﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace nplJobsDAL.Delete
{
    public class DeleteJobLocationWithin : DataAccessBase
    {
        public long JobId;

        public DeleteJobLocationWithin()
        {
            StoredProcedureName = StoredProcedure.Name.spDeleteJobLocationWinthinByJob.ToString();
        }

        public void Delete()
        {
            DeleteJobLocationWithinParameters parameters = new DeleteJobLocationWithinParameters(this.JobId);
            DataBaseHelper dbHelper = new DataBaseHelper(StoredProcedureName);
            dbHelper.Parameters = parameters.Parameters;
            object LastJobSeekerProfessionalInfoID = dbHelper.RunScalar();
        }
    }

    #region SQL parameters for Location info data parameters
    public class DeleteJobLocationWithinParameters
    {
        private long _JobId;
        private SqlParameter[] _parameters;

        public DeleteJobLocationWithinParameters(long JobId)
        {
            this._JobId = JobId;
            Build();
        }

        private void Build()
        {
            SqlParameter[] parameters = 
                {
                    new SqlParameter("@JobID", _JobId)
                };

            Parameters = parameters;
        }

        public SqlParameter[] Parameters
        {
            get { return _parameters; }
            set { _parameters = value; }
        }
    }
    #endregion
}
